package com.briup.corejava.day15;

import com.briup.corejava.day11.pojo.Student;

/**
 * 测试finally
 */
public class Test1 {
    public static int t1(){
        int i = 10;
        try {
            i = 11;
            return i;
        }finally {
            i = 12;
            try{

            }finally {
                return i;
            }
        }
    }
    public static Student test(){
        int a = 2;
        Student s = new Student("zhangsan",20);
        Student s1 = new Student();
        try {
            a = 4;
            s1 = new Student();
            System.out.println("try s1 - "+System.identityHashCode(s1));
            return s1;
        }finally {
            s1 = new Student();
            System.out.println("finally s1 -"+System.identityHashCode(s1));
        }
    }
    public static void main(String[] args) {
        System.out.println(System.identityHashCode(test()));
        try{
            int a = 1;
            if(a > 0){
                return ;
            }
        }finally {
            System.out.println("finally----");
        }
    }
}
